//
//  PPMeInfoSexCellFrame.m
//  PropertyManage
//
//  Created by Dreamsoul on 15-3-26.
//  Copyright (c) 2015年 com.lab603.mc. All rights reserved.
//

#import "PPMeInfoSexCellFrame.h"
#import "PPMe.h"
#define padding 5
@implementation PPMeInfoSexCellFrame
-(void)setMe:(PPMe *)me{
    _me = me;
    //背景图片
    CGFloat backgroundViewX = 0;
    CGFloat backgroundViewY = 0;
    CGFloat backgroundViewW = [UIScreen mainScreen].bounds.size.width;
    //根据内容计算得高度
    CGFloat backgroundViewH = 0;
    //头像
    CGSize sexIconSize = (CGSize){30,30};
    CGFloat sexIconX = [UIScreen mainScreen].bounds.size.width - 2*padding - sexIconSize.width;
    CGFloat sexIconY = padding;
    _sexIconF = (CGRect){{sexIconX,sexIconY},sexIconSize};
    backgroundViewH = CGRectGetMaxY(_sexIconF)+padding;
    //标题Label
    CGSize  titleSize = [me.titleString sizeWithFont:[UIFont systemFontOfSize:15.0]];
    CGFloat titleX = 2*padding;
    CGFloat titleY = backgroundViewH/2-titleSize.height/2;
    _titleF = (CGRect){{titleX,titleY},titleSize};
    
    //计算得高度以及cell的高度
    
    _backgroundViewF = CGRectMake(backgroundViewX, backgroundViewY, backgroundViewW, backgroundViewH);
    //cellHeight
    _cellHeight = backgroundViewH;
}
@end
